package cn.scw.project.facility.mapper;

import cn.scw.project.facility.domain.FacFacility;
import cn.scw.project.facility.domain.netework.bean.FacFacilityListReq;
import cn.scw.project.facility.domain.vo.FacFacilityVo;

import java.util.List;

/**
 * 设备Mapper接口
 *
 * @author api
 * @date 2020-05-20
 */
public interface FacFacilityMapper
{
    /**
     * 查询设备
     *
     * @param id 设备ID
     * @return 设备
     */
    public FacFacility selectFacFacilityById(Long id);

     FacFacilityVo selectFacFacilityVoById(Long id);

    FacFacility selectFacFacilityByCode(String code);

    FacFacilityVo selectFacFacilityVoByCode(String code);

    /**
     * 查询设备列表
     *
     * @param req 设备
     * @return 设备集合
     */
    public List<FacFacilityVo> selectFacFacilityList(FacFacilityListReq req);

    /**
     * 新增设备
     *
     * @param facFacility 设备
     * @return 结果
     */
    public int insertFacFacility(FacFacility facFacility);

    /**
     * 修改设备
     *
     * @param facFacility 设备
     * @return 结果
     */
    public int updateFacFacility(FacFacility facFacility);

    /**
     * 删除设备
     *
     * @param id 设备ID
     * @return 结果
     */
    public int deleteFacFacilityById(Long id);

    /**
     * 批量删除设备
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    public int deleteFacFacilityByIds(Long[] ids);

    boolean existsByCode(String code);

    int countByUser(Long userId);

    void autoUpdateIsExpire();

}
